package com.oct.ywsc.job.kafka;

import com.oct.ywsc.core.bean.MsgBean;
import org.apache.kafka.clients.consumer.ConsumerRecords;

import java.time.Duration;
import java.util.List;

public interface IClient {

    /**
     * 初始化客户端
     */
    public void init();

    /**
     * 拉取消息
     * @return
     */
    public List<MsgBean> poll(Duration maxPollIntervalMs);

    /**
     * 关闭客户端
     */
    public void close();


    /**
     * 同步提交偏移量
     */
    public void commitSync();

}
